package cn.sccl.common.scheduler.model;

import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * 任务的参数
 *
 * @author _minus
 * @create 2017-10-08 20:29
 */
public class TaskParams implements Serializable{

    private Object params;

    private String fireLogId ;

    public String getFireLogId() {
        return fireLogId;
    }

    public void setFireLogId(String fireLogId) {
        this.fireLogId = fireLogId;
    }

    public Object getParams() {
        return params;
    }

    public void setParams(Object params) {
        this.params = params;
    }


    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("参数：");
        sb.append(params.toString());
        sb.append("t_task_fire_log 日志id:");
        sb.append(fireLogId);
        return sb.toString();
    }

    /**
     * 校验数据是否合理
     * @return
     */
    public boolean validateData(){
        if(this.params ==null || StringUtils.isEmpty(this.params.toString()) || StringUtils.isEmpty(this.fireLogId)){
            return false ;
        }
        return true ;
    }
}
